package com.API.dal.entities;

// Generated 03.06.2013 4:15:36 by Hibernate Tools 4.0.0

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Costs generated by hbm2java
 */
@Entity
@Table(name = "COSTS", schema = "PUBLIC", catalog = "PUBLIC")
public class Costs implements java.io.Serializable {

	private Integer id;
	private CostsTypes costsTypes;
	private Date changeDate;
	private BigDecimal total;
	private String notes;
	private Set<ProjectsCosts> projectsCostses = new HashSet<ProjectsCosts>(0);
	private Set<EmployeesCosts> employeesCostses = new HashSet<EmployeesCosts>(
			0);
	private Set<EquipmentCosts> equipmentCostses = new HashSet<EquipmentCosts>(
			0);
	private Set<ContractorCost> contractorCosts = new HashSet<ContractorCost>(0);

	public Costs() {
	}

	public Costs(CostsTypes costsTypes, Date changeDate, BigDecimal total) {
		this.costsTypes = costsTypes;
		this.changeDate = changeDate;
		this.total = total;
	}

	public Costs(CostsTypes costsTypes, Date changeDate, BigDecimal total,
			String notes, Set<ProjectsCosts> projectsCostses,
			Set<EmployeesCosts> employeesCostses,
			Set<EquipmentCosts> equipmentCostses,
			Set<ContractorCost> contractorCosts) {
		this.costsTypes = costsTypes;
		this.changeDate = changeDate;
		this.total = total;
		this.notes = notes;
		this.projectsCostses = projectsCostses;
		this.employeesCostses = employeesCostses;
		this.equipmentCostses = equipmentCostses;
		this.contractorCosts = contractorCosts;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "COST_TYPE_ID", nullable = false)
	public CostsTypes getCostsTypes() {
		return this.costsTypes;
	}

	public void setCostsTypes(CostsTypes costsTypes) {
		this.costsTypes = costsTypes;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "CHANGE_DATE", nullable = false, length = 10)
	public Date getChangeDate() {
		return this.changeDate;
	}

	public void setChangeDate(Date changeDate) {
		this.changeDate = changeDate;
	}

	@Column(name = "TOTAL", nullable = false, precision = 128, scale = 0)
	public BigDecimal getTotal() {
		return this.total;
	}

	public void setTotal(BigDecimal total) {
		this.total = total;
	}

	@Column(name = "NOTES", length = 512)
	public String getNotes() {
		return this.notes;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "costs")
	public Set<ProjectsCosts> getProjectsCostses() {
		return this.projectsCostses;
	}

	public void setProjectsCostses(Set<ProjectsCosts> projectsCostses) {
		this.projectsCostses = projectsCostses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "costs")
	public Set<EmployeesCosts> getEmployeesCostses() {
		return this.employeesCostses;
	}

	public void setEmployeesCostses(Set<EmployeesCosts> employeesCostses) {
		this.employeesCostses = employeesCostses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "costs")
	public Set<EquipmentCosts> getEquipmentCostses() {
		return this.equipmentCostses;
	}

	public void setEquipmentCostses(Set<EquipmentCosts> equipmentCostses) {
		this.equipmentCostses = equipmentCostses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "costs")
	public Set<ContractorCost> getContractorCosts() {
		return this.contractorCosts;
	}

	public void setContractorCosts(Set<ContractorCost> contractorCosts) {
		this.contractorCosts = contractorCosts;
	}

}
